<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUsersRechargeLimitTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users_recharge_limit', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('admin_id')->default(0)->comment('管理人员');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->unsignedSmallInteger('recharge_rmb')->default(0)->comment('当日充值金额');
            $table->unsignedSmallInteger('total_recharge_rmb')->default(0)->comment('总充值金额限制');
            $table->unsignedTinyInteger('flag')->default(1)->comment('状态：1生效，0生效');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('users_recharge_limit');
    }
}
